package model

import "github.com/sagoo-cloud/sagooiot/internal/model/entity"

type GetDevOtaStrategyListInput struct {
	Id int `json:"id"          description:"ID"`
	PaginationInput
	Name             string `json:"name" description:"升级批次名称"`
	DevOtaFirewareId int    `json:"devOtaFirewareId" description:"升级包id" v:"required#升级包id不能为空"`
}
type DevOtaStrategyListOutput struct {
	Data []DevOtaStrategyOutput `json:"strategy"`
	PaginationOutput
}
type DevOtaStrategyOutput struct {
	entity.DevOtaStrategy
}
type DevOtaStrategyAddInput struct {
	Name             string `json:"name"        description:"名称"  v:"required#名称不能为空"`
	WaitVersion      string `json:"waitVersion" description:"待升级版本号" `
	Stratege         int    `json:"stratege"    description:"升级方式:1静态升级 ， 2动态升级"  v:"required#升级方式不能为空"`
	Push             int    `json:"push"        description:"主动推送:1是，2否"  v:"required#推送方式不能为空"`
	DevOtaFirewareId int    `json:"devOtaFirewareId"        description:"升级包id"  v:"required#升级包id不能为空"`
	Method           int    `json:"method"      description:"升级方式1http,2https,3mqtt"  v:"required#升级方式不能为空"`
	Typo             int    `json:"typo"             description:"1验证,2升级"`
	Devices          []int  `json:"devices"   description:"设备id"  `
}
type DevOtaStrategyEditInput struct {
	Id int `json:"id"          description:"ID"  v:"required#ID不能为空"`
	DevOtaStrategyAddInput
}

type DevStrategyOut struct {
	Url        string                 `json:"url"`
	Version    string                 `json:"version"`
	Module     string                 `json:"module"`
	Sign       string                 `json:"sign"`
	SignMethod string                 `json:"signMethod"`
	ExtData    map[string]interface{} `json:"extData"`
}

type UpgradeOut struct {
	Code int            `json:"code"`
	Data DevStrategyOut `json:"data"`
}

type Info struct {
	Step      int    `json:"step"`
	Strategy  int    `json:"strategy"`
	Version   string `json:"version"`
	DeviceKey string `json:"deviceKey"`
}
type Result struct {
	Id     string `json:"id"`
	Params Info   `json:"params"`
}
